-
Notifications
You must be signed in to change notification settings - Fork 22.7k
Proposed documentation for proposed Model element #39710
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
A full suite of the currently agreed-upon API and capability of the Model element, as discussed in the Immersive Web CG
rebuilt with the yarn builder so the lockfile should match upstream
Copied the yarn lockfile back to the upstream state
@mkeblx @LaszloGombos @cabanier Here's a run at the MDN docs! LMK if there's anything obviously outside of our discussions on it so far. |
Updated casing on some attribute/property names, update to the richer paths on things like Content categories
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some random drive-by reviews. Not comprehensive in any way, but they indicate some common problems that would need to be fixed throughout.
Also we need browser compat data for this. It should be shipping in at least one browser to be documented.
@@ -9836,4 +9836,4 @@ yoctocolors@^2.0.0: | |||
zwitch@^2.0.0, zwitch@^2.0.4: | |||
version "2.0.4" | |||
resolved "https://registry.yarnpkg.com/zwitch/-/zwitch-2.0.4.tgz#c827d4b0acb76fc3e685a4c6ec2902d51070e9d7" | |||
integrity sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A== | |||
integrity sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A== |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert
|
||
- While it provides benefits for all devices and User Agents, the `<model>` element has particular value on platforms with stereoscopic and/or head-tracking capabilities, such as Head-Mounted Displays (HMDs). It can be used as declarative alternative to the WebXR API to provide spatial content. | ||
|
||
## Object fit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be H3 headings. The H2 sequence is exactly those defined in the page template
A model's contents is set to automatically fit within the portal's | ||
`width` and `height` dimensions at the moment that the `ready` Promise |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
General comment: please don't wrap your prose like this. Either wrap at each period, or don't wrap and just have paragraph breaks
|
||
Setting the `stagemode` to `orbit` immediately has these consequences for the model element's `entityTransform`: | ||
|
||
- Transform is <strong>`orbit-fit`</strong>: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use Markdown
This example demonstrates how to confirm that both a model's scene and environment map resources are ready for rendering, and how to gracefully address failed parsing: | ||
|
||
```js | ||
let modelElem = document.getElementById("model"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use const
where possible
|
||
## See also | ||
|
||
- [model.ready](/en-US/docs/Web/API/HTMLModelElement/ready) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- [model.ready](/en-US/docs/Web/API/HTMLModelElement/ready) | |
- [`HTMLModelElement.ready`](/en-US/docs/Web/API/HTMLModelElement/ready) |
|
||
## See also | ||
|
||
- {{domxref("HTMLModelElement")}}: Interface used to define the `HTMLModelElement.entityTransform` property |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- {{domxref("HTMLModelElement")}}: Interface used to define the `HTMLModelElement.entityTransform` property | |
- {{domxref("HTMLModelElement")}} |
We don't add explanatory text for see also
Remove arbitrary wrapping, Change `let` to `const`, Fixed the 'ARIA role' reference urls, Demoted some headings to be in line with MDN standards, Applied markdown-based bolding
…into model-element
Description
This PR adds API documentation about the proposed HTML Model element, a browser-native feature for the in-line display of 3D content. It includes illustrations of some core concepts like perspective, lighting and appropriate file formats.
Motivation
The Model element is a totally new web feature and it'll be exceptionally difficult to add documentation in a piecemeal fashion. I'm hoping that this covers the core concepts enough to author new pages from, and matches the MDN house style well enough that other folks can improve them to the point that they are real!
Additional details
I am submitting provisional documentation for the HTML model element, a feature that is the major source of discussion in the W3C Immersive Web CG (https://github.com/immersive-web/model-element/ )
and which is available as a feature preview in visionOS 2.4. I am an editor of the specification and have been facilitating the discussion around it.
While the specification doesn’t have a lot of detail, the API in visionOS is based on the consensus discussion in the CG, and is described in the Model Element explainer: (https://github.com/immersive-web/model-element/blob/main/explainer.md )
There is also a WebGL/WebXR-based interactive explainer demo available here:
https://immersive-web.github.io/model-element/explainer_demo.html
We also have public samples being contributed by multiple browser vendors in the model element samples repository.
https://immersive-web.github.io/model-element-samples/
We have previously submitted related additions to the WHATWG HTML specification as via an introductory issue and initial PR for the specification stub.
whatwg/html#10901
whatwg/html#11191
Related issues and pull requests
WHATWG/HTML
model
element for display of inline 3D models whatwg/html#11191the Web Platform Tests repository
HTML-ARIA